﻿using Microsoft.AspNetCore.Mvc;
using RuoVea.Service;

namespace RuoVea.Api.Controllers
{
    /// <summary>
    /// 异常日志服务
    /// </summary>
    public class SysExLogController :   ApiBaseController 
    {
        private readonly ISysExLogService _sysExLogService;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sysExLogService"></param>
        public SysExLogController(ISysExLogService  sysExLogService   )
        {
            _sysExLogService = sysExLogService;
        }

        /// <summary>
        /// 分页查询异常日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet("page")]
        public async Task<dynamic> QueryExLogPageList([FromQuery] ExLogInput input)
        {
            return await _sysExLogService.QueryExLogPageList(input);
        }

        /// <summary>
        /// 清空异常日志
        /// </summary>
        /// <returns></returns>
        [HttpPost("delete")]
        public async Task ClearExLog()
        {
              await _sysExLogService.ClearExLog( );
        }
    }
}